#coding:utf-8
import pyodbc
connection = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=PACS70D;UID=sa;PWD=sa')
cur=connection.cursor()
cur.execute("delete T_PPatient")
print cur.rowcount, 'T_PPatient deleted'
cur.execute("delete T_PStudy")
print cur.rowcount, 'T_PStudy deleted'
cur.execute("delete T_NOFITSTUDY ")
print cur.rowcount, 'T_NOFITSTUDY deleted'
connection.commit()
raw_input('请按回车键结束'.decode('utf-8').encode('gbk'))